import { defineStore } from 'pinia'


export const useRdatStore = defineStore('rdat', {
    state: () => ({
        topicRecordList: [],
        currentId: null,
    }),
    getters: {},
    actions: {
        updateTopicRecordList(index, newItem) {
            console.log("index:", index)
            this.$patch({
                topicRecordList: () => {
                    const updatedItems = [...this.topicRecordList];
                    updatedItems[index] = newItem;
                    return updatedItems;
                }
            })
        }
    }
})
export default useRdatStore
